package com.jd.platform.gobrs.client.config;


import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * @program: gobrs
 * @ClassName BootstrapProperties
 * @description:
 * @author: sizegang
 * @create: 2022-01-08 17:30
 * @Version 1.0
 **/
@Slf4j
@ConfigurationProperties(prefix = BootstrapProperties.PREFIX)
public class BootstrapProperties {

    public static final String PREFIX = "spring.gobrs";

    private String appName;

    private boolean banPushCacheBroker = true; // 高并发下存在推送热key 存在并发问题 并发推

    private boolean hCache = true; // 二级缓存是否开启 默认不开启

    /**
     * Print  banner
     */
    private Boolean banner = true;
    /*缓存相关*/

    private String etcdServer;

    /**
     * 推送key的间隔(毫秒)，推送越快，探测的越密集，会越快探测出来，但对client资源消耗相应增大
     */
    private Long pushPeriod;


    /**
     * caffeine的最大容量，默认给5万
     */

    private int caffeineSize;

    private Boolean enable = true;

    /**************split*****************/

    public String getAppName() {
        return appName;
    }

    public void setAppName(String appName) {
        this.appName = appName;
    }

    public boolean isBanPushCacheBroker() {
        return banPushCacheBroker;
    }

    public void setBanPushCacheBroker(boolean banPushCacheBroker) {
        this.banPushCacheBroker = banPushCacheBroker;
    }

    public boolean ishCache() {
        return hCache;
    }

    public void sethCache(boolean hCache) {
        this.hCache = hCache;
    }

    public Boolean getBanner() {
        return banner;
    }

    public void setBanner(Boolean banner) {
        this.banner = banner;
    }

    public String getEtcdServer() {
        return etcdServer;
    }

    public void setEtcdServer(String etcdServer) {
        this.etcdServer = etcdServer;
    }

    public Long getPushPeriod() {
        return pushPeriod;
    }

    public void setPushPeriod(Long pushPeriod) {
        this.pushPeriod = pushPeriod;
    }

    public int getCaffeineSize() {
        return caffeineSize;
    }

    public void setCaffeineSize(int caffeineSize) {
        this.caffeineSize = caffeineSize;
    }

    public Boolean getEnable() {
        return enable;
    }

    public void setEnable(Boolean enable) {
        this.enable = enable;
    }
}